javax.realtime
Class MemoryParameters

java.lang.Object
  extended byjavax.realtime.MemoryParameters

public class MemoryParameters
extends java.lang.Object

Memory parameters can be given on the constructor of RealTimeThread and AsynchEventHandler. These can be used both for the purposes of admission control by the scheduler and for the purposes of pacing the garbage collector to satisfy all of the thread allocation rates.

When a reference to a MemoryParameters object is given as a parameter to a constructor, the MemoryParameters object becomes bound to the object being created. Changes to the values in the MemoryParameters object affect the constructed object. If given to more than one constructor, then changes to the values in the MemoryParameters object affect all of the associated objects. Note that this is a one-many relationship and not a many-to-many.

Caution: This class is explicitly unsafe in multithreaded situations when it is being changed. No synchronization is done. It is assumed that users of this class who are mutating instances will be doing their own synchronization at a higher level.


Field Summary
static long NO_MAX
           
 
Constructor Summary
MemoryParameters(long maxMemoryArea, long maxImmortal)
           
MemoryParameters(long maxMemoryArea, long maxImmortal, long allocationRate)
           
 
Method Summary
 long getAllocationRate()
           
 long getMaxImmortal()
           
 long getMaxMemoryArea()
           
 void setAllocationRate(long allocationRate)
           
 boolean setMaxImmortalIfFeasible(long maxImmortal)
           
 boolean setMaxMemoryAreaIfFeasible(long maxMemoryArea)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_MAX

public static final long NO_MAX
See Also:
Constant Field Values
Constructor Detail

MemoryParameters

public MemoryParameters(long maxMemoryArea,
                        long maxImmortal)
                 throws java.lang.IllegalArgumentException
Parameters:
maxMemoryArea -
maxImmortal -
Throws:
java.lang.IllegalArgumentException

MemoryParameters

public MemoryParameters(long maxMemoryArea,
                        long maxImmortal,
                        long allocationRate)
                 throws java.lang.IllegalArgumentException
Parameters:
maxMemoryArea -
maxImmortal -
allocationRate -
Throws:
java.lang.IllegalArgumentException
Method Detail

getAllocationRate

public long getAllocationRate()
Returns:
the allocation rate

getMaxImmortal

public long getMaxImmortal()
Returns:
the maximum immortal area size

getMaxMemoryArea

public long getMaxMemoryArea()
Returns:
the maximum memory area size

setAllocationRate

public void setAllocationRate(long allocationRate)
Parameters:
allocationRate -

setMaxImmortalIfFeasible

public boolean setMaxImmortalIfFeasible(long maxImmortal)
Parameters:
maxImmortal -
Returns:
true if the resulting system is feasible

setMaxMemoryAreaIfFeasible

public boolean setMaxMemoryAreaIfFeasible(long maxMemoryArea)
Parameters:
maxMemoryArea -
Returns:
true if the resulting system is feasible